#root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
  filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

.matrix-input h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.matrix-input h3:before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 20px;
  background-color: #3498db;
  margin-right: 10px;
  border-radius: 2px;
}

.matrix-container {
  overflow: auto;
  max-height: 400px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
}

.matrix-input table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.matrix-input th, .matrix-input td {
  border: 1px solid #e0e0e0;
  padding: 12px;
  text-align: center;
}

.matrix-input th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.matrix-input .row-header {
  background-color: #e9f7ff;
  font-weight: 600;
  text-align: center;
}

.matrix-input input {
  width: 70px;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.matrix-input input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
  outline: none;
}

.matrix-input .index {
  display: block;
  font-size: 0.9rem;
  color: #6c757d;
}

.matrix-hint {
  margin-top: 15px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #495057;
}

.matrix-hint p {
  font-weight: 500;
  margin-bottom: 5px;
}

.matrix-hint ul {
  margin-left: 20px;
  list-style-type: circle;
}

.dimensions-selector {
  padding: 20px;
  background: #f5f7fa;
  border-radius: 8px;
  margin-bottom: 25px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-text {
  min-width: 100px;
  font-weight: 500;
  color: #2c3e50;
}

.input-group input {
  padding: 12px;
  width: 120px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 1rem;
}

.presets {
  margin-top: 25px;
}

.presets p {
  font-weight: 500;
  margin-bottom: 10px;
}

.preset-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.preset-buttons button {
  padding: 10px 15px;
  background: #e9f7ff;
  color: #3498db;
  border: 1px solid #3498db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.preset-buttons button:hover {
  background: #d1f0ff;
}

.vector-section h3 {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.vector-section h3:before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 20px;
  background-color: #3498db;
  margin-right: 10px;
  border-radius: 2px;
}

.vector-input {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.vector-item {
  display: flex;
  align-items: center;
  background: white;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.vector-item span {
  margin-right: 10px;
  font-weight: 500;
  color: #495057;
}

.vector-item input {
  width: 80px;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.submit-btn {
  margin-top: 30px;
  padding: 14px 30px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.submit-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
/* 结果容器 */
.result-container {
  padding: 25px;
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.result-summary {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-badge {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 20px;
}

.status-badge.safe {
  background: linear-gradient(135deg, #43cea2, #185a9d);
  color: white;
}

.status-badge.unsafe {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  color: white;
}

.badge-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-content .icon {
  font-size: 1.5rem;
}

.safe-sequence, .unsafe-details {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px dashed #e0e0e0;
}

.safe-sequence h4, .unsafe-details h4 {
  margin-bottom: 12px;
  color: #555;
}

.sequence-display {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.process-badge {
  display: inline-block;
  padding: 8px 16px;
  background: #e3f2fd;
  border-radius: 6px;
  font-weight: 600;
  color: #1565c0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.process-badge.error {
  background: #ffebee;
  color: #c62828;
}

.arrow {
  color: #9e9e9e;
  font-size: 1.3rem;
}

.explanation-container {
  margin-top: 35px;
  padding: 25px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.explanation-content {
  margin-top: 15px;
  line-height: 1.7;
  color: #444;
  padding-left: 15px;
  border-left: 3px solid #3498db;
}

/* 错误消息样式 */
.error-message {
  margin-top: 20px;
  padding: 12px 20px;
  background: #ffebee;
  color: #c62828;
  border-radius: 6px;
  font-weight: 500;
}
/* 添加按钮样式 */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.submit-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.submit-btn.primary {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.submit-btn.primary:hover {
  background: linear-gradient(135deg, #2980b9, #3498db);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

.submit-btn.secondary {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.submit-btn.secondary:hover {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}

.submit-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 诊断说明 */
.diagnose-instructions {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #e74c3c;
}

.diagnose-instructions p {
  margin: 5px 0;
}

.diagnose-instructions .note {
  color: #e74c3c;
  font-weight: 500;
}

/* 算法解释面板 */
.algorithm-explanation {
  padding: 25px;
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}